<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加二维码信息</title>
<%@ include file="/WEB-INF/sys/include/css.jsp"%>
</head>
<body>
<form id="form" action="${path}/qrCode/save.json" method="post">
<div class="form">
	<div class="title">添加二维码信息</div>
	
	<div class="group">
		<div class="label">农作物:</div>
		<div class="item">
			<input type="text" id="cropDisplay" name="cropDisplay" />
			<input type="hidden" name="cropName" id="cropName" />
			<input type="hidden" name="cropid" id="cropid" />
		</div>
		<div class="item" id="cropDisplayTip"></div>
	</div>
	
	<div class="group">
		<div class="label">数量:</div>
		<div class="item"><input type="text" name="shu" id="shu" maxlength="20" /></div>
	</div>
		<div class="buttons">
		<button class="highlight" id="submit1" type="button">确定</button>
		<button type="button" id="cancel1">取消</button>
		<input type="hidden" name="parkid" id="parkid" value="${parkid}"/>
		<input type="hidden" name="type" id="type" value="${type}"/>
	</div>
</div>
</form>
<%@ include file="/WEB-INF/sys/include/script.jsp" %>
<script type="text/javascript">
$(function() {
/* 	createSelect("companyName", "companyid", {
		valueField:'companyid', textField: 'companyName',
		url:'${path}/qrCode/getCompanyData.json'
	}); */
	
/* 	createSelect("parkName", "parkid", {
		valueField:'parkid', textField: 'parkName',
		url:'${path}/inspection/item/getParkData.json'
	}); */
	
	createSelect("cropDisplay", "cropid", {
		tree:{url:'${path}/qrCode/getCropData.json?type=${type}'},
		onSelected: function(id, name, data){
			$("#cropName").val(!data ? "" : name);
		}
	});
	
	$("#form").ligerForm({inputWidth: 300});
	
	verifyForm("form", {}, function(){
		$("#form").ajaxForm(function(data){
			UiUtil.isSuccess(data, "添加信息成功", function(){
				UiUtil.closeForm(true);
			});
		});
	});
	
	$("#submit1").click(function(){
		UiUtil.lockButton('submit1');
		$("#form").submit();
	});

	$("#cancel1").click(function(){
		UiUtil.closeForm();
	});
	
	
});
</script>
</body>
</html>